﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConfigurationPage.aspx.cs" Inherits="EvaluationSystem.ConfigurationPages.ConfigurationPage" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

     <script type="text/javascript">
         var loadPage = function (tabPanel, node) {
             var tab = tabPanel.getItem(node.id);

             if (!tab) {
                 tab = tabPanel.add({
                     id: node.id,
                     title: node.text,
                     closable: true,
                     autoLoad: {
                         showMask: true,
                         url: node.attributes.href,
                         mode: "iframe",
                         maskMsg: "Loading..."
                     },
                     listeners: {
                         update: {
                             fn: function (tab, cfg) {
                                 cfg.iframe.setHeight(cfg.iframe.getSize().height - 20);
                             },
                             scope: this,
                             single: true
                         }
                     }
                 });
             }

             tabPanel.setActiveTab(tab);
         }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport ID="Viewport1" runat="server">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server">
                    <West>
                        <ext:TreePanel 
                            ID="tpSettings"
                            runat="server" 
                            Width="200" 
                            Title="管理..." 
                            Icon="ChartOrganisation">            
                            <Listeners>
                                <Click Handler="if (node.attributes.href) { e.stopEvent(); loadPage(#{Pages}, node); }" />
                            </Listeners>
                        </ext:TreePanel>
                    </West>
                    
                    <Center>
                       <ext:TabPanel ID="Pages" runat="server" EnableTabScroll="true" />
                    </Center>

                </ext:BorderLayout>
            </Items>
        </ext:Viewport>

    </form>
</body>
</html>
